﻿using System;
using System.ComponentModel;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using Kingdee.BOS;
using Newtonsoft.Json.Linq;
using System.Text;
using System.Collections.Generic;
using Kingdee.BOS.App.Data;
using KingdeeWebServiceProject.Data;
using KingdeeWebServiceProject.Utils;
using System.IO;
using System.IO.Ports;

namespace KingdeeWebServiceProject
{
    [ToolboxItem(false)]
    [WebService(Namespace = "http://schema.kingdee.com/KingdeeCardWebService./")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class KingdeeVIPCardWebService : WebService
    {
        //是否校验时间戳
        public bool time_flags = false;

        #region 暂未启用的接口
        //#region 会员关键信息查询
        //[WebMethod(Description = FuncDescription.QueryVIPMemberKeyValue)]
        //public string QueryVIPMemberKeyValue(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string MobileNo = CommonService.GetJParamString(jParams, "MobileNo");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        MobileNo = RSACryptoService.Decrypt(MobileNo, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(TimeStamp) && string.IsNullOrWhiteSpace(MobileNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】、【MobileNo：会员手机号】不能全部为空！";
        //        return result.ToString();
        //    }


        //    if (string.IsNullOrWhiteSpace(CardNo) && string.IsNullOrWhiteSpace(MobileNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】、【MobileNo：会员手机号】不能全部为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.QueryVIPMemberKeyValue(ctx, CardNo, MobileNo, result);
        //}
        //#endregion

        //#region 卡储值积分交易数据查询
        //[WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        //public string QueryVIPCardConsumeData(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string BeginDate = CommonService.GetJParamString(jParams, "BeginDate");
        //    string EndDate = CommonService.GetJParamString(jParams, "EndDate");
        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string AccountId = CommonService.GetJParamString(jParams, "AccountId");
        //    string PageSize = CommonService.GetJParamString(jParams, "PageSize");
        //    string PageNum = CommonService.GetJParamString(jParams, "PageNum");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        BeginDate = RSACryptoService.Decrypt(BeginDate, RSACryptoService.privateKey);
        //        EndDate = RSACryptoService.Decrypt(EndDate, RSACryptoService.privateKey);
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        AccountId = RSACryptoService.Decrypt(AccountId, RSACryptoService.privateKey);
        //        PageSize = RSACryptoService.Decrypt(AccountId, RSACryptoService.privateKey);
        //        PageNum = RSACryptoService.Decrypt(AccountId, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(CardNo))
        //    {
        //        result["Message"] = "参数【CardNo：卡号】不能为空！";
        //        return result.ToString();
        //    }

        //    long lAccountId = 0;
        //    long.TryParse(AccountId, out lAccountId);

        //    DateTime dtDate;
        //    if (!string.IsNullOrWhiteSpace(BeginDate))
        //    {
        //        if (!DateTime.TryParse(BeginDate, out dtDate))
        //        {
        //            result["Message"] = "参数【BeginDate：开始日期】设置错误！";
        //            return result.ToString();
        //        }
        //    }

        //    if (!string.IsNullOrWhiteSpace(EndDate))
        //    {
        //        if (!DateTime.TryParse(EndDate, out dtDate))
        //        {
        //            result["Message"] = "参数【EndDate：结束日期】设置错误！";
        //            return result.ToString();
        //        }
        //    }

        //    int iPageSize = 0;
        //    int iPageNum = 0;
        //    int.TryParse(PageSize, out iPageSize);
        //    int.TryParse(PageNum, out iPageNum);

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.QueryVIPCardConsumeData(ctx, BeginDate, EndDate, CardNo, lAccountId, iPageSize, iPageNum, result);
        //}
        //#endregion

        //#region 卡密码修改
        //[WebMethod(Description = FuncDescription.ModifyCardPassWord)]
        //public string ModifyCardPassWord(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string OldPassWord = CommonService.GetJParamString(jParams, "OldPassWord");
        //    string NewPassWord = CommonService.GetJParamString(jParams, "NewPassWord");
        //    string strUpdateAll = CommonService.GetJParamString(jParams, "bResetPassWord");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        OldPassWord = RSACryptoService.Decrypt(OldPassWord, RSACryptoService.privateKey);
        //        NewPassWord = RSACryptoService.Decrypt(NewPassWord, RSACryptoService.privateKey);
        //        strUpdateAll = RSACryptoService.Decrypt(strUpdateAll, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    bool bResetPassWord = false;
        //    bool.TryParse(strUpdateAll, out bResetPassWord);

        //    if (string.IsNullOrWhiteSpace(CardNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(OldPassWord) && !bResetPassWord)
        //    {
        //        result["Message"] = "参数【OldPassWord：原密码】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(NewPassWord))
        //    {
        //        result["Message"] = "参数【NewPassWord：新密码】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.ModifyCardPassWord(ctx, CardNo, OldPassWord, NewPassWord, bResetPassWord, result);
        //}
        //#endregion

        //#region 卡挂失解挂冻结解冻
        //[WebMethod(Description = FuncDescription.ModifyCardStatus)]
        //public string ModifyCardStatus(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string bizType = CommonService.GetJParamString(jParams, "bizType");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        bizType = RSACryptoService.Decrypt(bizType, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(CardNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(bizType))
        //    {
        //        result["Message"] = "参数【bizType：业务类型】不能为空！";
        //        return result.ToString();
        //    }
        //    if (bizType != "14" && bizType != "15" && bizType != "16" && bizType != "17")
        //    {
        //        result["Message"] = "参数【statusType：业务类型】值设置错误！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.ModifyCardStatus(ctx, CardNo, bizType, result);
        //}
        //#endregion

        //#region 卡有效期调整
        //[WebMethod(Description = FuncDescription.ModifyCardValidDate)]
        //public string ModifyCardValidDate(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string BeginDate = CommonService.GetJParamString(jParams, "BeginDate");
        //    string EndDate = CommonService.GetJParamString(jParams, "EndDate");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        BeginDate = RSACryptoService.Decrypt(BeginDate, RSACryptoService.privateKey);
        //        EndDate = RSACryptoService.Decrypt(EndDate, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(CardNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】不能为空！";
        //        return result.ToString();
        //    }
        //    if (!this.ValidDate(BeginDate, EndDate, result))
        //    {
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.ModifyCardValidDate(ctx, CardNo, BeginDate, EndDate, result);
        //}
        //#endregion

        //#region 卡账户有效期调整
        //[WebMethod(Description = FuncDescription.ModifyAcctValidDate)]
        //public string ModifyAcctValidDate(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string AccountId = CommonService.GetJParamString(jParams, "AccountId");
        //    string BeginDate = CommonService.GetJParamString(jParams, "BeginDate");
        //    string EndDate = CommonService.GetJParamString(jParams, "EndDate");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        AccountId = RSACryptoService.Decrypt(AccountId, RSACryptoService.privateKey);
        //        BeginDate = RSACryptoService.Decrypt(BeginDate, RSACryptoService.privateKey);
        //        EndDate = RSACryptoService.Decrypt(EndDate, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(CardNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(AccountId))
        //    {
        //        result["Message"] = "参数【AccountId：卡账户】不能为空！";
        //        return result.ToString();
        //    }
        //    if (!this.ValidDate(BeginDate, EndDate, result))
        //    {
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.ModifyAcctValidDate(ctx, CardNo, AccountId, BeginDate, EndDate, result);
        //}
        //#endregion

        //#region 商品账户有效期调整
        //[WebMethod(Description = FuncDescription.ModifySrvAcctValidDate)]
        //public string ModifySrvAcctValidDate(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string AccountId = CommonService.GetJParamString(jParams, "AccountId");
        //    string BeginDate = CommonService.GetJParamString(jParams, "BeginDate");
        //    string EndDate = CommonService.GetJParamString(jParams, "EndDate");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        AccountId = RSACryptoService.Decrypt(AccountId, RSACryptoService.privateKey);
        //        BeginDate = RSACryptoService.Decrypt(BeginDate, RSACryptoService.privateKey);
        //        EndDate = RSACryptoService.Decrypt(EndDate, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(CardNo))
        //    {
        //        result["Message"] = "参数【CardNo：会员卡号】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(AccountId))
        //    {
        //        result["Message"] = "参数【AccountId：卡账户】不能为空！";
        //        return result.ToString();
        //    }
        //    if (!this.ValidDate(BeginDate, EndDate, result))
        //    {
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.ModifySrvAcctValidDate(ctx, CardNo, AccountId, BeginDate, EndDate, result);
        //}
        //#endregion

        //#region 卡账户数据转移
        //[WebMethod(Description = FuncDescription.TransferCardAccount)]
        //public string TransferCardAccount(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string SrcCardNo = CommonService.GetJParamString(jParams, "SrcCardNo");
        //    string DesCardNo = CommonService.GetJParamString(jParams, "DesCardNo");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        SrcCardNo = RSACryptoService.Decrypt(SrcCardNo, RSACryptoService.privateKey);
        //        DesCardNo = RSACryptoService.Decrypt(DesCardNo, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(SrcCardNo))
        //    {
        //        result["Message"] = "参数【SrcCardNo：转出卡号】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(DesCardNo))
        //    {
        //        result["Message"] = "参数【DesCardNo：转入卡号】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.TransferCardAccount(ctx, SrcCardNo, DesCardNo, result);
        //}
        //#endregion

        //#region 常用基础资料查询
        //[WebMethod(Description = FuncDescription.QueryBaseDataInfo)]
        //public string QueryBaseDataInfo(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string TableName = CommonService.GetJParamString(jParams, "TableName");
        //    string FIDField = CommonService.GetJParamString(jParams, "FIDField");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        TableName = RSACryptoService.Decrypt(TableName, RSACryptoService.privateKey);
        //        FIDField = RSACryptoService.Decrypt(FIDField, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(TableName))
        //    {
        //        result["Message"] = "参数【TableName：基础数据表名】不能为空！";
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(FIDField))
        //    {
        //        result["Message"] = "参数【FIDField：内码字段名】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.QueryBaseDataInfo(ctx, TableName, FIDField, result);
        //}
        //#endregion

        //#region 新增第三方消费记录单
        //[WebMethod(Description = FuncDescription.TConsumptionBill)]
        //public string TConsumptionBill(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);
        //    //单据头信息字段array{}
        //    string billData = CommonService.GetJParamString(jParams, "billData");

        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");
        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }
        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }
        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：单据头数据包】不能为空！";
        //        return result.ToString();
        //    }
        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.TConsumptionBill(ctx, billData, result);

        //}
        //#endregion

        //#region 创建零售预订单
        //[WebMethod(Description = FuncDescription.CreateDepositBill)]
        //public string CreateDepositBill(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string billData = CommonService.GetJParamString(jParams, "billData");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：单据数据包】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.CreateDepositBill(ctx, billData, result);
        //}
        //#endregion

        //#region 创建电商订单表
        //[WebMethod(Description = FuncDescription.CreateOnlineOrderBill)]
        //public string CreateOnlineOrderBill(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string billData = CommonService.GetJParamString(jParams, "billData");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：单据数据包】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.CreateOnlineOrderBill(ctx, billData, result);
        //}
        //#endregion

        //#region 创建会员短信验证码
        //[WebMethod(Description = FuncDescription.CreateVIPSmsValidateCode)]
        //public string CreateVIPSmsValidateCode(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string billData = CommonService.GetJParamString(jParams, "billData");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：验证码数据包】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.CreateVIPSmsValidateCode(ctx, billData, result);
        //}
        //#endregion

        //#region 创建员工接口表数据
        //[WebMethod(Description = FuncDescription.CreateEmpInterfaceData)]
        //public string CreateEmpInterfaceData(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string billData = CommonService.GetJParamString(jParams, "billData");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：员工表数据包】不能为空！";
        //        return result.ToString();
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.CreateEmpInterfaceData(ctx, billData, result);
        //}
        //#endregion

        //#region 查询会员手机号修改记录
        //[WebMethod(Description = FuncDescription.QueryVIPMobileQueue)]
        //public string QueryVIPMobileQueue(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string BeginDate = CommonService.GetJParamString(jParams, "BeginDate");
        //    string EndDate = CommonService.GetJParamString(jParams, "EndDate");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        BeginDate = RSACryptoService.Decrypt(BeginDate, RSACryptoService.privateKey);
        //        EndDate = RSACryptoService.Decrypt(EndDate, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    DateTime dtBegin;
        //    if (string.IsNullOrWhiteSpace(BeginDate))
        //    {
        //        result["Message"] = "参数【BeginDate：开始日期】不能为空！";
        //        return result.ToString();
        //    }
        //    if (!DateTime.TryParse(BeginDate, out dtBegin))
        //    {
        //        result["Message"] = "参数【BeginDate：开始日期】不是有效的日期！";
        //        return result.ToString();
        //    }

        //    DateTime dtEnd;
        //    if (string.IsNullOrWhiteSpace(EndDate))
        //    {
        //        result["Message"] = "参数【EndDate：结束日期】不能为空！";
        //        return result.ToString();
        //    }
        //    if (!DateTime.TryParse(EndDate, out dtEnd))
        //    {
        //        result["Message"] = "参数【EndDate：结束日期】不是有效的日期！";
        //        return result.ToString();
        //    }
        //    if (dtEnd < dtBegin)
        //    {
        //        result["Message"] = "参数【EndDate：结束日期】不能小于【BeginDate：开始日期】！";
        //        return result.ToString();
        //    }

        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        return result.ToString();  //超时退出
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    return VipCard.QueryVIPMobileQueue(ctx, dtBegin, dtEnd, result);
        //}
        //#endregion

        //#region 大家乐消费订单
        //[WebMethod(Description = FuncDescription.DJLConsumptionOrder)]
        //public string DJLConsumptionOrder(string Params)
        //{
        //    JObject result = new JObject();
        //    JObject jParams = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("RegistMessage", "");
        //    result.Add("Data", string.Empty);
        //    try
        //    {
        //        jParams = JObject.Parse(Params);
        //    }
        //    catch (Exception)
        //    {
        //        result["Message"] = "格式错误，请检查报文格式，报文：" + jParams.ToString();
        //        return result.ToString();
        //    }

        //    //单据头信息字段
        //    string billData = CommonService.GetJParamString(jParams, "billData");
        //    //时间戳
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");
        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }
        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        //超时退出
        //        return result.ToString();
        //    }
        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：单据头数据包】不能为空！";
        //        return result.ToString();
        //    }
        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }
        //    //消费订单
        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.DJLConsumptionOrder(ctx, billData, result);
        //}
        //#endregion

        //#region 餐品同步接口
        //[WebMethod(Description = FuncDescription.DJLMealsSynchronization)]
        //public string DJLMealsSynchronization(string Params)
        //{
        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);
        //    if (string.IsNullOrWhiteSpace(Params))
        //    {
        //        result["Message"] = "参数【Params：请求参数】不能为空！";
        //        return result.ToString();
        //    }
        //    JObject jParams = JObject.Parse(Params);
        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        return result.ToString();
        //    }
        //    RetailBillService billServer = new RetailBillService();
        //    return billServer.DJLMealsSynchronization(ctx, Params, result);
        //}
        //#endregion

        //#region 礼券派发方案查询（会员领券）
        //[WebMethod(Description = FuncDescription.QueryVIPTicketScheme)]
        //public void QueryVIPTicketScheme(string Params)
        //{
        //    Context.Response.Clear();
        //    Context.Response.ContentType = "application/json";

        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string CardNo = CommonService.GetJParamString(jParams, "CardNo");
        //    string MobileNo = CommonService.GetJParamString(jParams, "MobileNo");
        //    string PageSize = CommonService.GetJParamString(jParams, "PageSize");
        //    string PageNum = CommonService.GetJParamString(jParams, "PageNum");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
        //        MobileNo = RSACryptoService.Decrypt(MobileNo, RSACryptoService.privateKey);
        //        PageSize = RSACryptoService.Decrypt(PageSize, RSACryptoService.privateKey);
        //        PageNum = RSACryptoService.Decrypt(PageNum, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (time_flags)
        //    {
        //        if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //        {
        //            Context.Response.Write(result.ToString());
        //            return;
        //        }
        //    }

        //    int iPageSize = 0;
        //    int iPageNum = 0;
        //    int.TryParse(PageSize, out iPageSize);
        //    int.TryParse(PageNum, out iPageNum);

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        Context.Response.Write(result.ToString());
        //        return;
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    Context.Response.Write(VipCard.QueryVIPTicketScheme(ctx, CardNo, MobileNo, iPageSize, iPageNum, result));
        //    return;
        //}
        //#endregion

        //#region 礼券领取（会员领券购券）
        //[WebMethod(Description = FuncDescription.VIPTicketSchemeAction)]
        //public void VIPTicketSchemeAction(string Params)
        //{
        //    Context.Response.Clear();
        //    Context.Response.ContentType = "application/json";

        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string strParams = CommonService.GetJParamString(jParams, "strParams");
        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

        //    if (this.isEncrypt(jParams))
        //    {
        //        strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }

        //    if (time_flags)
        //    {
        //        if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //        {
        //            Context.Response.Write(result.ToString());
        //            return;
        //        }
        //    }

        //    if (string.IsNullOrWhiteSpace(strParams))
        //    {
        //        result["Message"] = "参数【strParams：领券数据包】不能为空！";
        //        Context.Response.Write(result.ToString());
        //        return;
        //    }

        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        Context.Response.Write(result.ToString());
        //        return;
        //    }

        //    VIPCardService VipCard = new VIPCardService();
        //    Context.Response.Write(VipCard.VIPTicketSchemeAction(ctx, strParams, result));
        //    return;
        //}
        //#endregion
        #endregion

        //#region 交易单号查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryOrderNo(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrderNo = CommonService.GetJParamString(jParams, "OrderNo");
            if (string.IsNullOrWhiteSpace(OrderNo))
            {
                result["Message"] = "参数【OrderNo：交易单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryOrderNo(ctx, OrderNo, result));
            return;
        }

        #region 新增新增交易单
        [WebMethod()]
        public void BiddingTransStr(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject
            {
                { "Result", false },
                { "Message", "" },
                { "UserToken", string.Empty },
                { "Data", string.Empty }
            };
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string OrderNo = CommonService.GetJParamString(jParams, "OrderNo");
            if (string.IsNullOrWhiteSpace(OrderNo))
            {
                result["Message"] = "参数【OrderNo：交易单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string BuyerNumber = CommonService.GetJParamString(jParams, "BuyerNumber");
            if (string.IsNullOrWhiteSpace(BuyerNumber))
            {
                result["Message"] = "参数【BuyerNumber：买家编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            string PurAmountStr = CommonService.GetJParamString(jParams, "PurAmount");
            if (string.IsNullOrWhiteSpace(PurAmountStr))
            {
                result["Message"] = "参数【PurAmount：买家总金额】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal PurAmount;
            try
            {
                PurAmount = Convert.ToDecimal(PurAmountStr);
                if (PurAmount <= 0)
                {
                    result["Message"] = "参数【PurAmount：买家总金额】异常！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "参数【PurAmount：买家总金额】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string SellerNumber = CommonService.GetJParamString(jParams, "SellerNumber");
            if (string.IsNullOrWhiteSpace(SellerNumber))
            {
                result["Message"] = "参数【SellerNumber：卖家编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            string SaleAmountStr = CommonService.GetJParamString(jParams, "SaleAmount");
            if (string.IsNullOrWhiteSpace(SaleAmountStr))
            {
                result["Message"] = "参数【SaleAmount：卖家总金额】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal SaleAmount;
            try
            {
                SaleAmount = Convert.ToDecimal(SaleAmountStr);
                if (SaleAmount <= 0)
                {
                    result["Message"] = "参数【SaleAmount：卖家总金额】异常！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "参数【SaleAmount：卖家总金额】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string SalesProfitStr = CommonService.GetJParamString(jParams, "SalesProfit");
            if (string.IsNullOrWhiteSpace(SalesProfitStr))
            {
                result["Message"] = "参数【SalesProfit：销售利润】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal SalesProfit;
            try
            {
                SalesProfit = Convert.ToDecimal(SalesProfitStr);
                //if (SalesProfit <= 0)
                //{
                //    result["Message"] = "参数【SalesProfit：销售利润】异常！";
                //    Context.Response.Write(result.ToString());
                //    return;
                //}
            }
            catch (Exception)
            {
                result["Message"] = "参数【SalesProfit：销售利润】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string MaterialNumber = CommonService.GetJParamString(jParams, "MaterialNumber");
            if (string.IsNullOrWhiteSpace(MaterialNumber))
            {
                result["Message"] = "参数【MaterialNumber：商品编码】未设置！";
                Context.Response.Write(result.ToString());
                return;
            }

            string PurQtyStr = CommonService.GetJParamString(jParams, "PurQty");
            if (string.IsNullOrWhiteSpace(PurQtyStr))
            {
                result["Message"] = "参数【PurQty：采购数量】未设置！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal PurQty;
            try
            {
                PurQty = Convert.ToDecimal(PurQtyStr);
                if (PurQty <= 0)
                {
                    result["Message"] = "参数【PurQty：采购数量】异常！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "参数【PurQty：采购数量】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string PurPriceStr = CommonService.GetJParamString(jParams, "PurPrice");
            if (string.IsNullOrWhiteSpace(PurPriceStr))
            {
                result["Message"] = "参数【PurPrice：采购单价】未设置！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal PurPrice;
            try
            {
                PurPrice = Convert.ToDecimal(PurPriceStr);
                if (PurPrice <= 0)
                {
                    result["Message"] = "参数【PurPrice：采购单价】异常！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "参数【PurPrice：采购单价】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string SalQtyStr = CommonService.GetJParamString(jParams, "SalQty");
            if (string.IsNullOrWhiteSpace(SalQtyStr))
            {
                result["Message"] = "参数【SalQty：销售数量】未设置！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal SalQty;
            try
            {
                SalQty = Convert.ToDecimal(SalQtyStr);
                if (SalQty <= 0)
                {
                    result["Message"] = "参数【SalQty：销售数量】异常！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "参数【SalQty：销售数量】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string SalPriceStr = CommonService.GetJParamString(jParams, "SalPrice");
            if (string.IsNullOrWhiteSpace(SalPriceStr))
            {
                result["Message"] = "参数【SalPrice：销售单价】未设置！";
                Context.Response.Write(result.ToString());
                return;
            }

            decimal SalPrice;
            try
            {
                SalPrice = Convert.ToDecimal(SalPriceStr);
                if (SalPrice <= 0)
                {
                    result["Message"] = "参数【SalPrice：销售单价】异常！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "参数【SalPrice：销售单价】异常！";
                Context.Response.Write(result.ToString());
                return;
            }

            string userToken = CommonService.GetJParamString(jParams, "userToken");
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            Context ctx;
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AddBiddingTransData(ctx, OrderNo, OrgNumber, BuyerNumber, PurAmount, SellerNumber, SaleAmount, SalesProfit, PurQty, PurPrice, SalQty, SalPrice, MaterialNumber, result));
            return;
        }
        #endregion

        //#region 销售出库详情查询(其他出库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryInvitationCode(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string InvitationCode = CommonService.GetJParamString(jParams, "InvitationCode");
            string AreaNumber = CommonService.GetJParamString(jParams, "AreaNumber");
            string StafPhone = CommonService.GetJParamString(jParams, "StafPhone");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryInvitationCode(ctx, InvitationCode, AreaNumber, StafPhone, result));
            return;
        }


        //#region 销售员列表查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryTransactionList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("TotalCount", 0);
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MaterialNumber = CommonService.GetJParamString(jParams, "MaterialNumber");
            if (string.IsNullOrWhiteSpace(MaterialNumber))
            {
                result["Message"] = "参数【MaterialNumber：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");

            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryTransactionList(ctx, OrgNumber, MaterialNumber, iPageSize, iPageNum, result));
            return;
        }


        //#region 销售员列表查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySalerList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("TotalCount", 0);
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string SalerName = CommonService.GetJParamString(jParams, "SalerName");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySalerList(ctx, OrgNumber, SalerName, iPageSize, iPageNum, result));
            return;
        }



        //#region 用户注册
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void NewCreateUser(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

 
            JObject jParams = JObject.Parse(lstParams);
            string Name = CommonService.GetJParamString(jParams, "Name");
            if (string.IsNullOrWhiteSpace(Name))
            {
                result["Message"] = "参数【Name：用户名】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【Mobile：手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string SalerName = CommonService.GetJParamString(jParams, "SalerName");
            if (string.IsNullOrWhiteSpace(SalerName))
            {
                result["Message"] = "参数【SalerName：销售员名称】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.NewCreateUser(ctx, Name, SalerName, Mobile, OrgNumber, result));
            return;
        }



        //#region 用户名称唯一查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryUserName(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Name = CommonService.GetJParamString(jParams, "Name");
            if (string.IsNullOrWhiteSpace(Name))
            {
                result["Message"] = "参数【Name：用户名】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryUserName(ctx, Name, result));
            return;
        }

        //#region 批量新增商品接口JArray
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AllAddMaterials(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AllAddMaterials(ctx, jParams, result));
            return;
        }


        //#region 新增商品接口JArray
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AddMaterials(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FNumber = CommonService.GetJParamString(jParams, "Number");
            if (string.IsNullOrWhiteSpace(FNumber))
            {
                result["Message"] = "参数【FNumber：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FName = CommonService.GetJParamString(jParams, "Name");
            if (string.IsNullOrWhiteSpace(FName))
            {
                result["Message"] = "参数【FName：商品名称】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FScore = CommonService.GetJParamString(jParams, "Score");
            string FALCOHOLS = CommonService.GetJParamString(jParams, "Alcohols");
            string FNote = CommonService.GetJParamString(jParams, "Note");
            string FWineBase1 = CommonService.GetJParamString(jParams, "WineBase");
            if (string.IsNullOrWhiteSpace(FWineBase1))
            {
                result["Message"] = "参数【WineBase：酒庄酒款编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string Fsize = CommonService.GetJParamString(jParams, "Size");
            if (string.IsNullOrWhiteSpace(Fsize))
            {
                result["Message"] = "参数【Size：商品规格】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FWineYear1 = CommonService.GetJParamString(jParams, "WineYear");
            if (string.IsNullOrWhiteSpace(FWineBase1))
            {
                result["Message"] = "参数【WineYear：商品年份】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FAuxUnitID = CommonService.GetJParamString(jParams, "AuxUnit");
            if (string.IsNullOrWhiteSpace(FWineBase1))
            {
                result["Message"] = "参数【AuxUnit：商品包装】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AddMaterials(ctx, OrgNumber, FNumber, FName, FScore, FALCOHOLS, FNote, FWineBase1, Fsize, FWineYear1, FAuxUnitID, result));
            return;
        }



        //#region 新增酒款接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AddWineryTreasury(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string FNumber = CommonService.GetJParamString(jParams, "Number");
            if (string.IsNullOrWhiteSpace(FNumber))
            {
                result["Message"] = "参数【Number：酒款编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FName = CommonService.GetJParamString(jParams, "Name");
            if (string.IsNullOrWhiteSpace(FName))
            {
                result["Message"] = "参数【Name：酒款名称】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FDate = CommonService.GetJParamString(jParams, "Date");
            if (string.IsNullOrWhiteSpace(FDate))
            {
                result["Message"] = "参数【Date：日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FEnglish = CommonService.GetJParamString(jParams, "English");
            if (string.IsNullOrWhiteSpace(FEnglish))
            {
                result["Message"] = "参数【English：英文名】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FCountry = CommonService.GetJParamString(jParams, "Country");
            if (string.IsNullOrWhiteSpace(FCountry))
            {
                result["Message"] = "参数【Country：国家编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FStyle = CommonService.GetJParamString(jParams, "Style");
            if (string.IsNullOrWhiteSpace(FStyle))
            {
                result["Message"] = "参数【Style：类型编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FREGIONS = CommonService.GetJParamString(jParams, "Regions");
            if (string.IsNullOrWhiteSpace(FREGIONS))
            {
                result["Message"] = "参数【Regions：产区】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string F_ora_MulLangText = CommonService.GetJParamString(jParams, "MulLangText");
            if (string.IsNullOrWhiteSpace(F_ora_MulLangText))
            {
                result["Message"] = "参数【MulLangText：中文名】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AddWineryTreasury(ctx, FNumber, FDate, FName, FEnglish, FCountry, FStyle, FREGIONS, F_ora_MulLangText, result));
            return;
        }


        //#region 新增国家红酒类型接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AddAssistantData(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string FNumber = CommonService.GetJParamString(jParams, "Number");
            if (string.IsNullOrWhiteSpace(FNumber))
            {
                result["Message"] = "参数【Number：酒款编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FName = CommonService.GetJParamString(jParams, "Name");
            if (string.IsNullOrWhiteSpace(FName))
            {
                result["Message"] = "参数【Name：酒款名称】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FType = CommonService.GetJParamString(jParams, "Type");
            if (string.IsNullOrWhiteSpace(FType))
            {
                result["Message"] = "参数【Type：资料类型】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AddAssistantData(ctx, FNumber, FName, FType, result));
            return;
        }

        //#region 修改商品信息接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void UpdateMaterials(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FNumber = CommonService.GetJParamString(jParams, "Number");
            if (string.IsNullOrWhiteSpace(FNumber))
            {
                result["Message"] = "参数【FNumber：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FName = CommonService.GetJParamString(jParams, "Name");
            if (string.IsNullOrWhiteSpace(FName))
            {
                result["Message"] = "参数【FName：商品名称】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FScore = CommonService.GetJParamString(jParams, "Score");
            string FALCOHOLS = CommonService.GetJParamString(jParams, "Alcohols");
            string FNote = CommonService.GetJParamString(jParams, "Note");
            string FWineBase1 = CommonService.GetJParamString(jParams, "WineBase");
            if (string.IsNullOrWhiteSpace(FWineBase1))
            {
                result["Message"] = "参数【WineBase：酒庄酒款编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string Fsize = CommonService.GetJParamString(jParams, "Size");
            if (string.IsNullOrWhiteSpace(Fsize))
            {
                result["Message"] = "参数【Size：商品规格】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FWineYear1 = CommonService.GetJParamString(jParams, "WineYear");
            if (string.IsNullOrWhiteSpace(FWineBase1))
            {
                result["Message"] = "参数【WineYear：商品年份】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string FAuxUnitID = CommonService.GetJParamString(jParams, "AuxUnit");
            if (string.IsNullOrWhiteSpace(FWineBase1))
            {
                result["Message"] = "参数【AuxUnit：商品包装】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.UpdateMaterials(ctx, OrgNumber, FNumber, FName, FScore, FALCOHOLS, FNote, FWineBase1, Fsize, FWineYear1, FAuxUnitID, result));
            return;
        }


        //#region 销售出库列表查询(其他出库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryMisdeliveryList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("TotalCount", 0);
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Status = CommonService.GetJParamString(jParams, "Status");
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            string BDate = CommonService.GetJParamString(jParams, "BDate");
            string EDate = CommonService.GetJParamString(jParams, "EDate");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Status))
            {
                result["Message"] = "参数【Status：状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryMisdeliveryList(ctx, Mobile, OrgNumber, Status, BillNo, BDate, EDate, iPageSize, iPageNum, result));
            return;
        }


        //#region 销售出库详情查询(其他出库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryMisdelivery(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            if (string.IsNullOrWhiteSpace(BillNo))
            {
                result["Message"] = "参数【BillNo：单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryMisdelivery(ctx, BillNo, result));
            return;
        }


        //#region 采购入库列表查询(其他入库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryMiscellaneousList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("TotalCount", 0);
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Status = CommonService.GetJParamString(jParams, "Status");
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            string BDate = CommonService.GetJParamString(jParams, "BDate");
            string EDate = CommonService.GetJParamString(jParams, "EDate");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Status))
            {
                result["Message"] = "参数【Status：状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryMiscellaneousList(ctx, Mobile, OrgNumber, Status, BillNo, BDate, EDate, iPageSize, iPageNum, result));
            return;
        }

        //#region 采购入库详情查询(其他入库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryMiscellaneous(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            if (string.IsNullOrWhiteSpace(BillNo))
            {
                result["Message"] = "参数【BillNo：单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryMiscellaneous(ctx, BillNo, result));
            return;
        }

        //#region 竞价采购价格曲线图
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryPurPriceCurve(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MaterialNumber = CommonService.GetJParamString(jParams, "MaterialNumber");
            if (string.IsNullOrWhiteSpace(MaterialNumber))
            {
                result["Message"] = "参数【MaterialNumber：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MaxDate = CommonService.GetJParamString(jParams, "MaxDate");
            if (string.IsNullOrWhiteSpace(MaxDate))
            {
                result["Message"] = "参数【MaxDate：最大日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MinDate = CommonService.GetJParamString(jParams, "MinDate");
            if (string.IsNullOrWhiteSpace(MinDate))
            {
                result["Message"] = "参数【MinDate：最小日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryPurPriceCurve(ctx, OrgNumber, MaterialNumber, MaxDate, MinDate, result));
            return;
        }


        //#region 竞价销售价格曲线图
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySalePriceCurve(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MaterialNumber = CommonService.GetJParamString(jParams, "MaterialNumber");
            if (string.IsNullOrWhiteSpace(MaterialNumber))
            {
                result["Message"] = "参数【MaterialNumber：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MaxDate = CommonService.GetJParamString(jParams, "MaxDate");
            if (string.IsNullOrWhiteSpace(MaxDate))
            {
                result["Message"] = "参数【MaxDate：最大日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string MinDate = CommonService.GetJParamString(jParams, "MinDate");
            if (string.IsNullOrWhiteSpace(MinDate))
            {
                result["Message"] = "参数【MinDate：最小日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySalePriceCurve(ctx, OrgNumber, MaterialNumber, MaxDate, MinDate, result));
            return;
        }


        //#region 竞价采购入库列表查询(采购入库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryInStockList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            string BDate = CommonService.GetJParamString(jParams, "BDate");
            string EDate = CommonService.GetJParamString(jParams, "EDate");
            string Status = CommonService.GetJParamString(jParams, "Status");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Status))
            {
                result["Message"] = "参数【Status：状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryInStockList(ctx, Mobile, OrgNumber, Status, BillNo, BDate, EDate, iPageSize, iPageNum, result));
            return;
        }


        //#region 竞价采购入库详情查询(采购入库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryInStock(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            if (string.IsNullOrWhiteSpace(BillNo))
            {
                result["Message"] = "参数【BillNo：单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryInStock(ctx, BillNo, result));
            return;
        }

        //#region 竞价销售出库列表查询(销售出库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryOutStockList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            string BDate = CommonService.GetJParamString(jParams, "BDate");
            string EDate = CommonService.GetJParamString(jParams, "EDate");
            string Status = CommonService.GetJParamString(jParams, "Status");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Status))
            {
                result["Message"] = "参数【Status：状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryOutStockList(ctx, Mobile, OrgNumber, Status, BillNo, BDate, EDate, iPageSize, iPageNum, result));
            return;
        }


        //#region 竞价销售出库详情查询(销售出库)
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryOutStock(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            if (string.IsNullOrWhiteSpace(BillNo))
            {
                result["Message"] = "参数【BillNo：单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryOutStock(ctx, BillNo, result));
            return;
        }


        #region 其他入库集成接口
        [WebMethod(Description = "其他入库集成接口")]
        public void MISCELLANEOUS(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.MISCELLANEOUS(ctx, lstParams, result));
            return;
        }
        #endregion


        #region 其他出库集成接口
        [WebMethod(Description = "其他出库集成接口")]
        public void STK_MisDelivery(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.STK_MisDelivery(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 通用操作按钮
        [WebMethod(Description = "通用操作按钮")]
        public void GeneralButton(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.GeneralButton(ctx, lstParams, result));
            return;
        }
        #endregion

        //#region 即时库存查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void Inventory(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MaterialNumber = CommonService.GetJParamString(jParams, "MaterialNumber");
            string MaterialName = CommonService.GetJParamString(jParams, "MaterialName");
            string Type = CommonService.GetJParamString(jParams, "Type");
            string DCost = CommonService.GetJParamString(jParams, "DCost");
            string LCost = CommonService.GetJParamString(jParams, "LCost");
            string DTradePrice = CommonService.GetJParamString(jParams, "DTradePrice");
            string LTradePrice = CommonService.GetJParamString(jParams, "LTradePrice");
            string DGroupPrice = CommonService.GetJParamString(jParams, "DGroupPrice");
            string LGroupPrice = CommonService.GetJParamString(jParams, "LGroupPrice");
            string DBaseQty = CommonService.GetJParamString(jParams, "DBaseQty");
            string LBaseQty = CommonService.GetJParamString(jParams, "LBaseQty");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【Mobile：手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.Inventory(ctx, Mobile, OrgNumber, MaterialNumber, MaterialName, Type, DCost, LCost, DTradePrice, LTradePrice, DGroupPrice, LGroupPrice, DBaseQty, LBaseQty, iPageSize, iPageNum, result));
            return;
        }


        //#region 更新商品价格
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void UpdateMaterialPrcie(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MaterialNumber = CommonService.GetJParamString(jParams, "MaterialNumber");
            string Cost = CommonService.GetJParamString(jParams, "Cost");
            string TradePrice = CommonService.GetJParamString(jParams, "TradePrice");
            string GroupPrice = CommonService.GetJParamString(jParams, "GroupPrice");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(MaterialNumber))
            {
                result["Message"] = "参数【MaterialNumber：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.UpdateMaterialPrcie(ctx, Mobile, OrgNumber, MaterialNumber, Cost, TradePrice, GroupPrice, result));
            return;
        }

        /////////////////////////////////
        //#region 登录验证
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void LoginSystemAuth(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("TimeStamp", string.Empty);
            //LogDataCenterForWebService logService = new LogDataCenterForWebService();
            //logService.ClearWebServiceLogCache();
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            Context.Response.Write(result.ToString());
            return;
        }

        //#region 区域查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryArea(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Number = CommonService.GetJParamString(jParams, "Number");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryArea(ctx, Number, result));
            return;
        }

        //#region 包装列表查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryUnitlist(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryUnitlist(ctx, result));
            return;
        }

        //#region 规格列表查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySizelist(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySizelist(ctx, result));
            return;
        }


        //#region 用户权限查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryUser(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryUser(ctx, Mobile, OrgNumber, result));
            return;
        }


        //#region 库存修改价格权限查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryUpdatePrice(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryUpdatePrice(ctx, Mobile, OrgNumber, result));
            return;
        }


        //#region 用户组织权限查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryUserOrg(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【MobileNo：用户手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryUserOrg(ctx, Mobile, OrgNumber, result));
            return;
        }

        //#region 更新商品上架
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void UpdateNmuber(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.UpdateNmuber(ctx, lstParams, result));
            return;
        }

        //#region 查询商家保证金，余额信息
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryStore(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MerchantNumber = CommonService.GetJParamString(jParams, "MerchantNumber");

            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryStore(ctx, Mobile, OrgNumber, MerchantNumber, result));
            return;
        }


        //#region 商家信息列表
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryStoreList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MerchantNumber = CommonService.GetJParamString(jParams, "MerchantNumber");
            string StafPhone = CommonService.GetJParamString(jParams, "StafPhone");
            string MerchantName = CommonService.GetJParamString(jParams, "MerchantName");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryStoreList(ctx, OrgNumber, MerchantNumber, MerchantName, StafPhone, iPageSize, iPageNum, result));
            return;
        }


        //#region 经纪人提成列表
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AccountManagerList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string StafPhone = CommonService.GetJParamString(jParams, "StafPhone");
            string StafName = CommonService.GetJParamString(jParams, "StafName");
            string StatisticalDate = CommonService.GetJParamString(jParams, "StatisticalDate");
            string To = CommonService.GetJParamString(jParams, "To");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AccountManagerList(ctx, OrgNumber, StafPhone, StafName, StatisticalDate, To, iPageSize, iPageNum, result));
            return;
        }


        //#region 查询商品信息
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void MaterialInfo(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Number = CommonService.GetJParamString(jParams, "Number");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");


            string ChineseName = CommonService.GetJParamString(jParams, "ChineseName");
            string EnglishName = CommonService.GetJParamString(jParams, "EnglishName");
            string Year = CommonService.GetJParamString(jParams, "Year");
            string Area = CommonService.GetJParamString(jParams, "Area");
            string Capacity = CommonService.GetJParamString(jParams, "Capacity");
            string MinimumOrder = CommonService.GetJParamString(jParams, "MinimumOrder");
            string GPurchaseQuantity = CommonService.GetJParamString(jParams, "GPurchaseQuantity");
            string GSalesQuantity = CommonService.GetJParamString(jParams, "GSalesQuantity");
            string LPurchaseQuantity = CommonService.GetJParamString(jParams, "LPurchaseQuantity");
            string LSalesQuantity = CommonService.GetJParamString(jParams, "LSalesQuantity");
            string Grounding = CommonService.GetJParamString(jParams, "Grounding");


            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");


            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.MaterialInfo(ctx, Number, OrgNumber, ChineseName, EnglishName, Year, Area, Capacity, MinimumOrder, GPurchaseQuantity, GSalesQuantity, LPurchaseQuantity, LSalesQuantity, Grounding, iPageSize, iPageNum, result));
            return;
        }


        //#region 查询酒款信息列表查询
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void WinePaymentInfo(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);

            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");


            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.WinePaymentInfo(ctx, iPageSize, iPageNum, result));
            return;
        }


        //#region 竞价采购订单列表
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryPurchaseOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MaterialName = CommonService.GetJParamString(jParams, "MaterialName");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(TransStatus))
            {
                result["Message"] = "参数【TransStatus：交易状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryPurchaseOrder(ctx, Mobile, OrgNumber, MaterialName, TransStatus, iPageSize, iPageNum, result));
            return;
        }


        //#region 实时竞价列表
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryPurSalesOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MaterialName = CommonService.GetJParamString(jParams, "MaterialName");
            string Year = CommonService.GetJParamString(jParams, "Year");
            string Capacity = CommonService.GetJParamString(jParams, "Capacity");
            string MinimumOrder = CommonService.GetJParamString(jParams, "MinimumOrder");
            string GPurchaseQuantity = CommonService.GetJParamString(jParams, "GPurchaseQuantity");
            string GSalesQuantity = CommonService.GetJParamString(jParams, "GSalesQuantity");
            string LPurchaseQuantity = CommonService.GetJParamString(jParams, "LPurchaseQuantity");
            string LSalesQuantity = CommonService.GetJParamString(jParams, "LSalesQuantity");
            string GPurchasePrice = CommonService.GetJParamString(jParams, "GPurchasePrice");
            string GSalesPrice = CommonService.GetJParamString(jParams, "GSalesPrice");
            string LPurchasePrice = CommonService.GetJParamString(jParams, "LPurchasePrice");
            string LSalesPrice = CommonService.GetJParamString(jParams, "LSalesPrice");
            string OrderBy = CommonService.GetJParamString(jParams, "OrderBy");
            string ProductArea = CommonService.GetJParamString(jParams, "ProductArea");
            string Type = CommonService.GetJParamString(jParams, "Type");
            string WineNumber = CommonService.GetJParamString(jParams, "WineNumber");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【Mobile：手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryPurSalesOrder(ctx, Mobile, OrgNumber, Year, Capacity, MinimumOrder, GPurchaseQuantity, GSalesQuantity, LPurchaseQuantity, LSalesQuantity, MaterialName,
                GPurchasePrice, GSalesPrice, LPurchasePrice, LSalesPrice, OrderBy, ProductArea, WineNumber, Type, iPageSize, iPageNum, result));
            return;
        }



        //#region 竞价销售订单列表
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySalesOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MaterialName = CommonService.GetJParamString(jParams, "MaterialName");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(TransStatus))
            {
                result["Message"] = "参数【TransStatus：交易状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySalesOrder(ctx, Mobile, OrgNumber, MaterialName, TransStatus, iPageSize, iPageNum, result));
            return;
        }


        //#region 竞价采购订单详情
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryPurchaseOrderDetail(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Material))
            {
                result["Message"] = "参数【Material：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(TransStatus))
            {
                result["Message"] = "参数【TransStatus：交易状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryPurchaseOrderDetail(ctx, Mobile, OrgNumber, Material, TransStatus, iPageSize, iPageNum, result));
            return;
        }


        //#region 竞价销售订单详情
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySalesOrderDetail(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Material))
            {
                result["Message"] = "参数【Material：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(TransStatus))
            {
                result["Message"] = "参数【TransStatus：交易状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySalesOrderDetail(ctx, Mobile, OrgNumber, Material, TransStatus, iPageSize, iPageNum, result));
            return;
        }


        //#region 我的竞价采购订单
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryPurchaseOrderDetails(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");

            string TransNo = CommonService.GetJParamString(jParams, "TransNo");
            string GbApplicationDate = CommonService.GetJParamString(jParams, "GbApplicationDate");
            string LbApplicationDate = CommonService.GetJParamString(jParams, "LbApplicationDate");
            string GbSubmitdate = CommonService.GetJParamString(jParams, "GbSubmitdate");
            string LbSubmitdate = CommonService.GetJParamString(jParams, "LbSubmitdate");
            string MaterialName = CommonService.GetJParamString(jParams, "MaterialName");
            string GbPurQty = CommonService.GetJParamString(jParams, "GbPurQty");
            string LbPurQty = CommonService.GetJParamString(jParams, "LbPurQty");
            string GbPurAmount = CommonService.GetJParamString(jParams, "GbPurAmount");
            string LbPurAmount = CommonService.GetJParamString(jParams, "LbPurAmount");
            string LogisticsStatus = CommonService.GetJParamString(jParams, "LogisticsStatus");
            string CollectStatus = CommonService.GetJParamString(jParams, "CollectStatus");

            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【Mobile：手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            //if (string.IsNullOrWhiteSpace(TransStatus))
            //{
            //    result["Message"] = "参数【TransStatus：交易状态】不能为空！";
            //    Context.Response.Write(result.ToString());
            //    return;
            //}
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryPurchaseOrderDetails(ctx, Mobile, OrgNumber, Material, TransStatus, TransNo, GbApplicationDate, LbApplicationDate, GbSubmitdate, LbSubmitdate, MaterialName, GbPurQty, LbPurQty, GbPurAmount, LbPurAmount, LogisticsStatus, CollectStatus, iPageSize, iPageNum, result));
            return;
        }


        //#region 我的竞价销售订单
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySalesOrderDetails(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");


            string TransNo = CommonService.GetJParamString(jParams, "TransNo");
            string GbApplicationDate = CommonService.GetJParamString(jParams, "GbApplicationDate");
            string LbApplicationDate = CommonService.GetJParamString(jParams, "LbApplicationDate");
            string GbSubmitdate = CommonService.GetJParamString(jParams, "GbSubmitdate");
            string LbSubmitdate = CommonService.GetJParamString(jParams, "LbSubmitdate");
            string MaterialName = CommonService.GetJParamString(jParams, "MaterialName");
            string GbSalQty = CommonService.GetJParamString(jParams, "GbSalQty");
            string LbSalQty = CommonService.GetJParamString(jParams, "LbSalQty");
            string GbSalAmount = CommonService.GetJParamString(jParams, "GbSalAmount");
            string LbSalAmount = CommonService.GetJParamString(jParams, "LbSalAmount");
            string LogisticsStatus = CommonService.GetJParamString(jParams, "LogisticsStatus");
            string CollectStatus = CommonService.GetJParamString(jParams, "CollectStatus");


            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【Mobile：手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            //if (string.IsNullOrWhiteSpace(TransStatus))
            //{
            //    result["Message"] = "参数【TransStatus：交易状态】不能为空！";
            //    Context.Response.Write(result.ToString());
            //    return;
            //}
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySalesOrderDetails(ctx, Mobile, OrgNumber, Material, TransStatus, TransNo, GbApplicationDate, LbApplicationDate, GbSubmitdate, LbSubmitdate, MaterialName, GbSalQty, LbSalQty, GbSalAmount, LbSalAmount, LogisticsStatus, CollectStatus, iPageSize, iPageNum, result));
            return;
        }


        //#region 批量查询我的竞价销售订单列表
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AllQuerySalesOrderDetails(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Mobile = CommonService.GetJParamString(jParams, "Mobile");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Mobile))
            {
                result["Message"] = "参数【Mobile：手机号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AllQuerySalesOrderDetails(ctx, Mobile, OrgNumber, Material, result));
            return;
        }


        //#region 我的竞价采购订单
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryPurchaseOrderRetail(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(BillNo))
            {
                result["Message"] = "参数【BillNo：单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryPurchaseOrderRetail(ctx, BillNo, OrgNumber, iPageSize, iPageNum, result));
            return;
        }


        //#region 我的竞价销售订单
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QuerySalesOrderRetail(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string BillNo = CommonService.GetJParamString(jParams, "BillNo");
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(BillNo))
            {
                result["Message"] = "参数【BillNo：单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QuerySalesOrderRetail(ctx, BillNo, OrgNumber, iPageSize, iPageNum, result));
            return;
        }

        //#region 竞价销售修改接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void UpDateBiddingSalesOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Number = CommonService.GetJParamString(jParams, "Number");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");
            string SalQty = CommonService.GetJParamString(jParams, "SalQty");
            string SalAmount = CommonService.GetJParamString(jParams, "SalAmount");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Number))
            {
                result["Message"] = "参数【Number：竞价销售单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(TransStatus))
            {
                result["Message"] = "参数【TransStatus：交易状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int FSalQty = 0;
            int.TryParse(SalQty, out FSalQty);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.UpDateBiddingSalesOrder(ctx, Number, TransStatus, FSalQty, SalAmount, result));
            return;
        }


        //#region 批量竞价销售修改接口JArray
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void AllUpDateBiddingSalesOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.AllUpDateBiddingSalesOrder(ctx, jParams, result));
            return;
        }

        //#region 竞价采购修改接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void UpDateBiddingPurchaseOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string Number = CommonService.GetJParamString(jParams, "Number");
            string TransStatus = CommonService.GetJParamString(jParams, "TransStatus");
            string PurQty = CommonService.GetJParamString(jParams, "PurQty");
            string PurAmount = CommonService.GetJParamString(jParams, "PurAmount");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(Number))
            {
                result["Message"] = "参数【Number：竞价销售单号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(TransStatus))
            {
                result["Message"] = "参数【TransStatus：交易状态】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int FPurQty = 0;
            int.TryParse(PurQty, out FPurQty);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.UpDateBiddingPurchaseOrder(ctx, Number, TransStatus, FPurQty, PurAmount, result));
            return;
        }

        //#region 竞价采购新增接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void BiddingPurchaseOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MerchantNumber = CommonService.GetJParamString(jParams, "MerchantNumber");
            string Date = CommonService.GetJParamString(jParams, "Date");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string PurQty = CommonService.GetJParamString(jParams, "PurQty");
            string PurAmount = CommonService.GetJParamString(jParams, "PurAmount");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(MerchantNumber))
            {
                result["Message"] = "参数【MerchantNumber：商家编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Date))
            {
                result["Message"] = "参数【Date：发布日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Material))
            {
                result["Message"] = "参数【Material：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(PurQty))
            {
                result["Message"] = "参数【PurQty：采购数量】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(PurAmount))
            {
                result["Message"] = "参数【PurAmount：采购单价】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int FPurQty = 0;
            int.TryParse(PurQty, out FPurQty);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.BiddingPurchaseOrder(ctx, OrgNumber, MerchantNumber, Material, Date, FPurQty, PurAmount, result));
            return;
        }


        //#region 竞价销售新增接口
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void BiddingSalesOrder(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(lstParams);
            string OrgNumber = CommonService.GetJParamString(jParams, "OrgNumber");
            string MerchantNumber = CommonService.GetJParamString(jParams, "MerchantNumber");
            string Date = CommonService.GetJParamString(jParams, "Date");
            string Material = CommonService.GetJParamString(jParams, "Material");
            string SalQty = CommonService.GetJParamString(jParams, "SalQty");
            string SalAmount = CommonService.GetJParamString(jParams, "SalAmount");
            string userToken = CommonService.GetJParamString(jParams, "userToken");
            if (string.IsNullOrWhiteSpace(OrgNumber))
            {
                result["Message"] = "参数【OrgNumber：区域编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(MerchantNumber))
            {
                result["Message"] = "参数【MerchantNumber：商家编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Date))
            {
                result["Message"] = "参数【Date：发布日期】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(Material))
            {
                result["Message"] = "参数【Material：商品编码】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(SalQty))
            {
                result["Message"] = "参数【SalQty：销售数量】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            if (string.IsNullOrWhiteSpace(SalAmount))
            {
                result["Message"] = "参数【SalAmount：销售单价】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            Context ctx = null;
            LogDataCenterForWebService logService = new LogDataCenterForWebService();
            JObject logSuccess = logService.GetLogContextFromCache(userToken, out ctx);
            if (!Convert.ToBoolean((logSuccess["Result"] as JValue).Value))
            {
                result["Message"] = "本次登陆错误：" + logSuccess["Message"];
                Context.Response.Write(result.ToString());
                return;
            }
            if (ctx == null)
            {
                result["Message"] = "WebService登录失败，登录上下文为空，请确认登录信息是否正确";
                Context.Response.Write(result.ToString());
                return;
            }
            int FSalQty = 0;
            int.TryParse(SalQty, out FSalQty);
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.BiddingSalesOrder(ctx, OrgNumber, MerchantNumber, Material, Date, FSalQty, SalAmount, result));
            return;
        }





        //#region 库存对比
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void QueryMaterial(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(lstParams);

            string isAll = CommonService.GetJParamString(jParams, "isAll");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");
            string FMaterialId = CommonService.GetJParamString(jParams, "FMaterialId");
            string FStockId = CommonService.GetJParamString(jParams, "FStockId");
            string FVkNumber = CommonService.GetJParamString(jParams, "FVkNumber");

            if (this.isEncrypt(jParams))
            {
                PageSize = RSACryptoService.Decrypt(PageSize, RSACryptoService.privateKey);
                PageNum = RSACryptoService.Decrypt(PageNum, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            LogHelper.WirteLog("库存对比", "请求参数", lstParams.ToString());

            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryMaterial(ctx, iPageSize, iPageNum, FMaterialId, FStockId, FVkNumber, result));
            return;
        }

        //#region 资金对比
        [WebMethod(Description = FuncDescription.QueryVIPCardConsumeData)]  //
        public void Capital(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            string isAll = CommonService.GetJParamString(jParams, "Isall");
            string PageSize = CommonService.GetJParamString(jParams, "PageSize");
            string PageNum = CommonService.GetJParamString(jParams, "PageNum");
            string FCONTACTUNIT = CommonService.GetJParamString(jParams, "FCONTACTUNIT");
            int iPageSize = 0;
            int iPageNum = 0;
            int.TryParse(PageSize, out iPageSize);
            int.TryParse(PageNum, out iPageNum);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.Capital(ctx, iPageSize, iPageNum, FCONTACTUNIT, result));
            return;
        }

        #region 会员信息查询
        [WebMethod(Description = FuncDescription.QueryVIPMemberInfo)]
        public void QueryVIPMemberInfo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string CardNo = CommonService.GetJParamString(jParams, "CardNo");
            string MobileNo = CommonService.GetJParamString(jParams, "MobileNo");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
                MobileNo = RSACryptoService.Decrypt(MobileNo, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(TimeStamp) && string.IsNullOrWhiteSpace(MobileNo))
            {
                result["Message"] = "参数【CardNo：会员卡号】、【MobileNo：会员手机号】不能全部为空！";
                Context.Response.Write(result.ToString());
                return;
            }


            if (string.IsNullOrWhiteSpace(CardNo) && string.IsNullOrWhiteSpace(MobileNo))
            {
                result["Message"] = "参数【CardNo：会员卡号】、【MobileNo：会员手机号】不能全部为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryVIPMemberInfo(ctx, CardNo, MobileNo, result));
            return;
        }
        #endregion

        #region 会员基本信息修改
        internal string ModefiyVipBaseInfo(Context ctx, string strParams, JObject result)
        {
            result["Result"] = false;
            StringBuilder StrSql = new StringBuilder();
            List<SqlParam> list = new List<SqlParam>();
            JObject jParams = JObject.Parse(strParams);
            string SoureMobile = CommonService.GetJParamString(jParams, "SoureMobile");
            if (string.IsNullOrWhiteSpace(SoureMobile))
            {
                result["Message"] = "会员原手机号不能为空！";
                return result.ToString();
            }

            string NewMobile = CommonService.GetJParamString(jParams, "NewMobile");
            if (!string.IsNullOrWhiteSpace(NewMobile))
            {
                StrSql.AppendLine("UPDATE CMK_T_VIP_Member SET FMOBILE =@NewMobile WHERE FMOBILE=@SoureMobile;");
                list.Add(new SqlParam("@NewMobile", KDDbType.String, NewMobile));
            }
            string NickName = CommonService.GetJParamString(jParams, "NickName");
            if (!string.IsNullOrWhiteSpace(NickName))
            {
                StrSql.AppendLine("UPDATE CMK_T_VIP_Member_L SET FNAME=@NickName WHERE FLocaleID=2052 AND FVIPID IN (SELECT FVIPID FROM CMK_T_VIP_Member WHERE FMOBILE=@SoureMobile);");
                list.Add(new SqlParam("@NickName", KDDbType.String, NickName));
            }
            string Sex = CommonService.GetJParamString(jParams, "Sex");
            string vIPSex = CommonService.xGetAuxDataIdByName(ctx, Sex, "8bcd487d7147412b832895578579089f");
            if (!string.IsNullOrWhiteSpace(Sex))
            {
                StrSql.AppendLine("UPDATE CMK_T_VIP_Member SET FSEX =@SEX WHERE FMOBILE=@SoureMobile;");
                list.Add(new SqlParam("@SEX", KDDbType.String, vIPSex));
            }

            string Birthday = CommonService.GetJParamString(jParams, "Birthday");

            if (!string.IsNullOrWhiteSpace(Birthday))
            {
                StrSql.AppendLine("UPDATE CMK_T_VIP_Member SET FBIRTHDAY =@Birthday WHERE FMOBILE=@SoureMobile;");
                list.Add(new SqlParam("@Birthday", KDDbType.String, Birthday));
            }
            string Email = CommonService.GetJParamString(jParams, "Email");

            if (!string.IsNullOrWhiteSpace(Email))
            {
                StrSql.AppendLine("UPDATE CMK_T_VIP_Member SET FEMAIL =@Email WHERE FMOBILE=@SoureMobile;");
                list.Add(new SqlParam("@Email", KDDbType.String, Email));
            }

            list.Add(new SqlParam("@SoureMobile", KDDbType.String, SoureMobile));
            var qure = XDDDBUtils.ExecuteDateSet(StrSql.ToString(), list);
            if (qure != null && qure.Tables.Count > 0 && qure.Tables[0].Rows.Count > 0)
            {
                result["Result"] = true;
                result["Code"] = 1;
                result["Message"] = "会员信息更新成功!";
            }
            else
            {
                result["Result"] = false;
                result["Code"] = 0;
                result["Message"] = "会员信息更新失败!";
            }
            return result.ToString();
        }
        #endregion

        #region 会员信息修改
        [WebMethod(Description = FuncDescription.ModifyVIPMemberInfo)]
        public void ModifyVIPMemberInfo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string vipParams = CommonService.GetJParamString(jParams, "vipParams");
            string strUpdateAll = CommonService.GetJParamString(jParams, "bUpdateAll");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                vipParams = RSACryptoService.Decrypt(vipParams, RSACryptoService.privateKey);
                strUpdateAll = RSACryptoService.Decrypt(strUpdateAll, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (!CommonService.CompareTimeStamp(TimeStamp, result))
            {
                Context.Response.Write(result.ToString());
                return;
            }

            bool bUpdateAll = false;
            bool.TryParse(strUpdateAll, out bUpdateAll);

            if (string.IsNullOrWhiteSpace(vipParams))
            {
                result["Message"] = "参数【vipParams：会员数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }


            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.ModifyVIPMemberInfo(ctx, vipParams, bUpdateAll, result));
            return;
        }
        #endregion

        #region 会员手机号修改
        [WebMethod(Description = FuncDescription.ModifyVIPMobile)]
        public void ModifyVIPMobile(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("ResCode", "200");
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string billData = CommonService.GetJParamString(jParams, "billData");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (!CommonService.CompareTimeStamp(TimeStamp, result))
            {
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(billData))
            {
                result["Message"] = "参数【billData：手机修改数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (!CommonService.CompareTimeStamp(TimeStamp, result))
            {
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.ModifyVIPMobile(ctx, billData, result));
            return;
        }
        #endregion

        #region 测试系统登陆验证
        [WebMethod(Description = FuncDescription.TestLoginSystemAuth)]
        public void TestLoginSystemAuth(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            Context ctx = null;
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            //建立Token维护机制
            string xdd_Token = result["UserToken"].ToString();
            //更新到数据库中，有效其校验为一小时（其他接口校验有效期时间）
            //建表，FID，FTokenValue，FExpiryTime




            result["Result"] = true;
            result["Message"] = "系统登陆验证成功";
            Context.Response.Write(result.ToString());
            return;
        }
        #endregion

        #region 新会员注册
        [WebMethod(Description = FuncDescription.RegisterVIPMember)]
        public void RegisterVIPMember(string Params)
        {
            //Utils.LogHelper.WirteSystemLog("新会员注册：", Params.ToString());
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("ResCode", 100);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);


            string vipParams = CommonService.GetJParamString(jParams, "vipParams");
            string cardParams = CommonService.GetJParamString(jParams, "cardParams");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                vipParams = RSACryptoService.Decrypt(vipParams, RSACryptoService.privateKey);
                cardParams = RSACryptoService.Decrypt(cardParams, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(vipParams))
            {
                result["Message"] = "参数【vipParams：会员数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(cardParams))
            {
                result["Message"] = "参数【cardParams：卡数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.RegisterVIPMember(ctx, vipParams, cardParams, result));
            return;
        }
        #endregion

        #region 礼券信息查询
        [WebMethod(Description = FuncDescription.QueryTicketInfo)]
        public void QueryTicketInfo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string BranchNumber = CommonService.GetJParamString(jParams, "BranchNumber");
            string TicketNo = CommonService.GetJParamString(jParams, "TicketNo");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                BranchNumber = RSACryptoService.Decrypt(BranchNumber, RSACryptoService.privateKey);
                TicketNo = RSACryptoService.Decrypt(TicketNo, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(TicketNo) && string.IsNullOrWhiteSpace(TicketNo))
            {
                result["Message"] = "参数【TicketNo：礼券编号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryTicketInfo(ctx, BranchNumber, TicketNo, result));
            return;
        }
        #endregion

        #region 礼券查询（会员持券）
        [WebMethod(Description = FuncDescription.QueryVIPTickets)]
        public void QueryVIPTickets(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string CardNo = CommonService.GetJParamString(jParams, "CardNo");
            string MobileNo = CommonService.GetJParamString(jParams, "MobileNo");
            //string BranchNumber = CommonService.GetJParamString(jParams, "BranchNumber");
            string TickStatus = CommonService.GetJParamString(jParams, "TickStatus");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
                MobileNo = RSACryptoService.Decrypt(MobileNo, RSACryptoService.privateKey);
                //BranchNumber = RSACryptoService.Decrypt(BranchNumber, RSACryptoService.privateKey);
                TickStatus = RSACryptoService.Decrypt(TickStatus, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(CardNo) && string.IsNullOrWhiteSpace(MobileNo))
            {
                result["Message"] = "参数【CardNo：会员卡号】、【MobileNo：会员手机号】不能全部为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryVIPTickets(ctx, CardNo, MobileNo, "", TickStatus, result));
            return;
        }
        #endregion

        #region 礼券发售
        [WebMethod(Description = FuncDescription.TicketPublish)]
        public void TicketPublish(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(Params);
            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：礼券发售数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial：交易序列号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.TicketPublish(ctx, strParams, TransSerial, result));
            return;
        }
        #endregion

        #region 礼券发售冲正
        [WebMethod(Description = FuncDescription.TicketPublishUndo)]
        public void TicketPublishUndo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial：交易序列号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.TicketPublishUndo(ctx, TransSerial, result));
            return;
        }
        #endregion

        #region 礼券消费
        [WebMethod(Description = FuncDescription.TicketConsume)]
        public void TicketConsume(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            //礼券消费记录核销来源渠道（POS、扫码点餐）
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：礼券消费数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial：交易序列号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.TicketConsume(ctx, strParams, TransSerial, result));
            return;
        }
        #endregion

        #region 礼券消费冲正
        [WebMethod(Description = FuncDescription.TicketConsumeUndo)]
        public void TicketConsumeUndo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：礼券消费数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial：交易序列号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.TicketConsumeUndo(ctx, strParams, TransSerial, result));
            return;
        }
        #endregion

        ////////////////////////////////////////////////////////////////////////////////////沃谷用到的接口////////////////////////////////////////////////////////////////////////////////////

        #region 卡账户交易
        [WebMethod(Description = FuncDescription.CardAcctTransAction)]
        public void CardAcctTransAction(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";


            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);
            StringBuilder LogData = new StringBuilder();
            LogData.AppendLine("请求报文：" + Params);

            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：卡账户交易数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial：交易序列号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            string response_str = VipCard.CardAcctTransAction(ctx, strParams, TransSerial, result);
            LogData.AppendLine("请求报文结果：" + response_str.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""));
            LogHelper.WirteLog("小程序", "卡账户交易", LogData.ToString());
            Context.Response.Write(response_str);
            return;
        }
        #endregion

        #region 卡账户交易冲正
        [WebMethod(Description = FuncDescription.CardAcctTransActionUndo)]
        public void CardAcctTransActionUndo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";


            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);
            StringBuilder LogData = new StringBuilder();
            LogData.AppendLine(Params);

            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：卡账户交易数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            string response_str = VipCard.CardAcctTransActionUndo(ctx, strParams, TransSerial, result);
            LogData.AppendLine("请求报文结果：" + response_str);
            LogHelper.WirteLog("小程序", "卡账户交易", LogData.ToString());
            Context.Response.Write(response_str);
            return;
        }
        #endregion

        #region 会员卡信息查询
        [WebMethod(Description = FuncDescription.QueryVIPCardInfo)]
        public void QueryVIPCardInfo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string CardNo = CommonService.GetJParamString(jParams, "CardNo");
            string MobileNo = CommonService.GetJParamString(jParams, "MobileNo");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
                MobileNo = RSACryptoService.Decrypt(MobileNo, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(CardNo) && string.IsNullOrWhiteSpace(MobileNo))
            {
                result["Message"] = "参数【CardNo：会员卡号】、【MobileNo：会员手机号】不能全部为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    Context.Response.Write(result.ToString());
            //    return;
            //}

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.QueryVIPCardInfo(ctx, CardNo, MobileNo, result));
            return;
        }
        #endregion

        #region 卡级别调整
        [WebMethod(Description = FuncDescription.ModifyCardLevel)]
        public string ModifyCardLevel(string Params)
        {
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string CardNo = CommonService.GetJParamString(jParams, "CardNo");
            string cardLevel = CommonService.GetJParamString(jParams, "CardLevel");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                CardNo = RSACryptoService.Decrypt(CardNo, RSACryptoService.privateKey);
                cardLevel = RSACryptoService.Decrypt(cardLevel, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    return result.ToString();  //超时退出
                }
            }

            if (string.IsNullOrWhiteSpace(CardNo))
            {
                result["Message"] = "参数【CardNo：会员卡号】不能为空！";
                return result.ToString();
            }
            if (string.IsNullOrWhiteSpace(cardLevel))
            {
                result["Message"] = "参数【cardLevel：卡级别编码】不能为空！";
                return result.ToString();
            }

            Context ctx = null;
            //bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            //if (!logSuccess)
            //{
            //    return result.ToString();
            //}

            VIPCardService VipCard = new VIPCardService();
            return VipCard.ModifyCardLevel(ctx, CardNo, cardLevel, result);
        }
        #endregion

        #region 实体卡消费接口（沃谷实体卡消费）
        [WebMethod(Description = "实体卡消费接口")]
        public void CardConsumption(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            string IsApplets = "false";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);
            StringBuilder LogData = new StringBuilder();
            LogData.AppendLine(Params);
            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：卡账户交易数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial：交易序列号】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;

            VIPCardService VipCard = new VIPCardService();
            string response_str = VipCard.CardAcctTransAction(ctx, strParams, TransSerial, result, IsApplets);
            LogData.AppendLine("请求报文结果：" + response_str.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""));
            LogHelper.WirteLog("寺冈收银", "卡账户交易", LogData.ToString());
            Context.Response.Write(response_str);
            return;
        }
        #endregion

        #region 实体卡消费冲正接口（沃谷实体卡消费冲正）
        [WebMethod(Description = "实体卡消费冲正接口")]
        public void CardConsumptionUndo(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string strParams = CommonService.GetJParamString(jParams, "strParams");
            string TransSerial = CommonService.GetJParamString(jParams, "TransSerial");
            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (this.isEncrypt(jParams))
            {
                strParams = RSACryptoService.Decrypt(strParams, RSACryptoService.privateKey);
                TransSerial = RSACryptoService.Decrypt(TransSerial, RSACryptoService.privateKey);
                TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
            }

            if (time_flags)
            {
                if (!CommonService.CompareTimeStamp(TimeStamp, result))
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(strParams))
            {
                result["Message"] = "参数【strParams：卡账户交易数据包】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            if (string.IsNullOrWhiteSpace(TransSerial))
            {
                result["Message"] = "参数【TransSerial】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }

            Context ctx = null;

            VIPCardService VipCard = new VIPCardService();
            Context.Response.Write(VipCard.CardAcctTransActionUndo(ctx, strParams, TransSerial, result));
            return;
        }
        #endregion

        #region 小程序密码修改同步接口
        [WebMethod(Description = "小程序密码修改同步接口")]
        public void QueryCardCustomPassword(string Params)
        {
            Context ctx = null;
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Code", 0);
            result.Add("Message", "系统登录失败!");
            result.Add("Data", string.Empty);
            JObject jParams = JObject.Parse(Params);
            string CardNo = CommonService.GetJParamString(jParams, "CardNo");
            if (string.IsNullOrWhiteSpace(CardNo))
            {
                result["Message"] = "会员卡号不能为空";
            }
            string CardPassword = CommonService.GetJParamString(jParams, "CardPassword");
            if (string.IsNullOrWhiteSpace(CardPassword))
            {
                result["Message"] = "会员卡密码不能为空";
            }
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            VIPCardService service = new VIPCardService();
            Context.Response.Write(service.QueryCardCustomPassword(ctx, CardNo, CardPassword, result));

            return;
        }
        #endregion

        #region 商品同步接口
        [WebMethod(Description = "创建物料")]
        public void CMKMaterialClass(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.CreateGoods(ctx, lstParams, result));
            return;
        }
        #endregion


        #region 客户同步接口
        [WebMethod(Description = "创建客户")]
        public void Customer(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.Customer(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 供应商同步接口
        [WebMethod(Description = "创建供应商")]
        public void Supplier(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.Supplier(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 仓库同步接口
        [WebMethod(Description = "创建仓库")]
        public void STOCK(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.STOCK(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 组织间结算价目表同步接口
        [WebMethod(Description = "创建组织间结算价目表")]
        public void PriceList(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.PriceList(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 组织间结算价目表同步接口
        [WebMethod(Description = "创建组织间结算价目表")]
        public void AdjustPrice(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            LogHelper.WirteLog("VIVO", "VK请求", lstParams);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.AdjustPrice(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 采购入库单集成接口
        [WebMethod(Description = "采购入库单集成接口")]
        public void InStock(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.InStock(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 销售出库单集成接口
        [WebMethod(Description = "销售出库单集成接口")]
        public void OUTSTOCK(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.OUTSTOCK(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 销售退货单集成接口
        [WebMethod(Description = "销售退货单集成接口")]
        public void RETURNSTOCK(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.RETURNSTOCK(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 直接调拨单集成接口
        [WebMethod(Description = "直接调拨单集成接口")]
        public void TransferDirect(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            //lstParams = RSACryptoService.Encrypt(lstParams, RSACryptoService.publicKey);
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);

            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.TransferDirect(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 其他出库单集成接口
        [WebMethod(Description = "其他出库单集成接口")]
        public void MisDelivery(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.MisDelivery(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 其他入库单集成接口
        [WebMethod(Description = "其他入库单集成接口")]
        public void MISCELLANEOUSs(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.MISCELLANEOUS(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 盘盈单集成接口
        [WebMethod(Description = "盘盈单集成接口")]
        public void StockCountGain(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.StockCountGain(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 盘亏单集成接口
        [WebMethod(Description = "盘亏单集成接口")]
        public void StockCountLoss(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.StockCountLoss(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 收款单集成接口
        [WebMethod(Description = "收款单集成接口")]
        public void RECEIVEBILL(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.RECEIVEBILL(ctx, lstParams, result));
            return;
        }
        #endregion

        #region 退款单集成接口
        [WebMethod(Description = "退款单集成接口")]
        public void REFUNDBILL(string lstParams)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);
            if (string.IsNullOrWhiteSpace(lstParams))
            {
                result["Message"] = "参数【lstParams：请求参数】不能为空！";
                Context.Response.Write(result.ToString());
                return;
            }
            lstParams = RSACryptoService.Decrypt(lstParams, RSACryptoService.privateKey);
            JObject jParams = JObject.Parse(lstParams);
            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            CMKRetailService billServer = new CMKRetailService();
            Context.Response.Write(billServer.REFUNDBILL(ctx, lstParams, result));
            return;
        }
        #endregion


        //#region 订单同步接口
        //[WebMethod(Description = "创建零售单")]
        //public void CMKRetailClass(string Params)
        //{
        //    Context.Response.Clear();
        //    Context.Response.ContentType = "application/json";

        //    JObject result = new JObject();
        //    result.Add("Result", false);
        //    result.Add("Message", "");
        //    result.Add("UserToken", string.Empty);
        //    result.Add("RegistMessage", "");
        //    result.Add("Data", string.Empty);

        //    JObject jParams = JObject.Parse(Params);

        //    string billData = CommonService.GetJParamString(jParams, "billData");

        //    string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");
        //    if (this.isEncrypt(jParams))
        //    {
        //        billData = RSACryptoService.Decrypt(billData, RSACryptoService.privateKey);
        //        TimeStamp = RSACryptoService.Decrypt(TimeStamp, RSACryptoService.privateKey);
        //    }
        //    if (!CommonService.CompareTimeStamp(TimeStamp, result))
        //    {
        //        Context.Response.Write(result.ToString());
        //        return;  //超时退出
        //    }
        //    if (string.IsNullOrWhiteSpace(billData))
        //    {
        //        result["Message"] = "参数【billData：单据头数据包】不能为空！";
        //        Context.Response.Write(result.ToString());
        //        return;
        //    }
        //    Context ctx = null;
        //    bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
        //    if (!logSuccess)
        //    {
        //        Context.Response.Write(result.ToString());
        //        return;
        //    }
        //    CMKRetailService billServer = new CMKRetailService();
        //    Context.Response.Write(billServer.CreatCMKRetailBill(ctx, billData, result));
        //    return;

        //}
        //#endregion

        #region 小程序获取充值记录是否已使用
        [WebMethod(Description = "小程序获取充值记录是否已使用")]
        public void GetBatchIsUse(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(Params);

            string CardNo = CommonService.GetJParamString(jParams, "CardNo");
            string CardLevelNo = CommonService.GetJParamString(jParams, "CardLevelNo");

            string TimeStamp = CommonService.GetJParamString(jParams, "TimeStamp");

            if (!CommonService.CompareTimeStamp(TimeStamp, result))
            {
                Context.Response.Write(result.ToString());
                return;  //超时退出
            }

            Context ctx = null;
            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                Context.Response.Write(result.ToString());
                return;
            }
            VIPCardService VipServer = new VIPCardService();
            Context.Response.Write(VipServer.UpdateAppletsHyCardLevel(ctx, CardNo, CardLevelNo));
            return;
        }

        #endregion


        [WebMethod(Description = "查询物料信息")]   //查询物料信息
        public string QueryMaterialInfo(string lstParams)
        {
            Context ctx = null;
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(lstParams);

            string FNumber = CommonService.GetJParamString(jParams, "FNumber");

            if (this.isEncrypt(jParams))
            {
                FNumber = RSACryptoService.Decrypt(FNumber, RSACryptoService.privateKey);
            }

            if (string.IsNullOrWhiteSpace(FNumber))
            {
                result["Message"] = "参数【FNumber：物料编码】不能为空！";
                return result.ToString();
            }

            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                return result.ToString();
            }

            VIPCardService VipCard = new VIPCardService();
            return VipCard.QueryMaterialInfo(ctx, FNumber, result);
        }



        [WebMethod(Description = "更新商品维修单")]   //更新商品维修单
        public string MallRepairOrder(string lstParams)
        {
            Context ctx = null;
            JObject result = new JObject();
            result.Add("Result", false);
            result.Add("Message", "");
            result.Add("UserToken", string.Empty);
            result.Add("Data", string.Empty);

            JObject jParams = JObject.Parse(lstParams);

            string FBILLNO = CommonService.GetJParamString(jParams, "FBILLNO");
            string FMAINTENANCEAMOUNT = CommonService.GetJParamString(jParams, "FMAINTENANCEAMOUNT");
            string FBUSINESSSTATUS = CommonService.GetJParamString(jParams, "FBUSINESSSTATUS");//
            string FMAILINGNUMBER = CommonService.GetJParamString(jParams, "FMAILINGNUMBER");
            string FRECIPIENTNAME = CommonService.GetJParamString(jParams, "FRECIPIENTNAME");
            string FRECIPIENTPHONE = CommonService.GetJParamString(jParams, "FRECIPIENTPHONE");
            string FRETURNADDRESS = CommonService.GetJParamString(jParams, "FRETURNADDRESS");
            if (this.isEncrypt(jParams))
            {
                FBILLNO = RSACryptoService.Decrypt(FBILLNO, RSACryptoService.privateKey);
            }

            if (string.IsNullOrWhiteSpace(FBILLNO))
            {
                result["Message"] = "参数【FBILLNO：单号】不能为空！";
                return result.ToString();
            }

            bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
            if (!logSuccess)
            {
                return result.ToString();
            }

            VIPCardService VipCard = new VIPCardService();
            return VipCard.MallRepairOrder(ctx, FBILLNO, FMAINTENANCEAMOUNT, FBUSINESSSTATUS, FMAILINGNUMBER, FRECIPIENTNAME, FRECIPIENTPHONE, FRETURNADDRESS, result);
        }


        #region 加密、验证生效、失效日期
        private bool isEncrypt(JObject jParams)
        {
            bool isEncrypt = false;
            string strEncrypt = CommonService.GetJParamString(jParams, "isEncrypt");
            bool.TryParse(strEncrypt, out isEncrypt);

            return isEncrypt;
        }

        //验证生效、失效日期
        private bool ValidDate(string BeginDate, string EndDate, JObject result)
        {
            DateTime dt;
            if (string.IsNullOrWhiteSpace(BeginDate))
            {
                result["Message"] = "参数【BeginDate：生效日期】不能为空！";
                return false;
            }
            if (!DateTime.TryParse(BeginDate, out dt))
            {
                result["Message"] = "参数【BeginDate：生效日期】不是有效的日期！";
                return false;
            }
            if (string.IsNullOrWhiteSpace(EndDate))
            {
                result["Message"] = "参数【EndDate：失效日期】不能为空！";
                return false;
            }
            if (!DateTime.TryParse(EndDate, out dt))
            {
                result["Message"] = "参数【EndDate：失效日期】不是有效的日期！";
                return false;
            }
            if (Convert.ToDateTime(EndDate) < Convert.ToDateTime(BeginDate))
            {
                result["Message"] = "参数【EndDate：失效日期】不能小于【BeginDate：生效日期】！";
                return false;
            }
            if (Convert.ToDateTime(EndDate) < DateTime.Now.Date)
            {
                result["Message"] = "参数【EndDate：失效日期】不能当前日期！";
                return false;
            }

            return true;
        }
        #endregion

        ////////////////////////////////////////////////////////////////////////////////////web api二开接口////////////////////////////////////////////////////////////////////////////////////

        #region Web Api 二开接口
        #region 单据查询
        [WebMethod(Description = "单据查询")]
        public void K3BillQuery(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            //物料分组数据查询接口
            if (jParams["formid"].ToString().Equals("BD_MATERIELGROUP"))
            {
                Context ctx = null;
                bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
                if (!logSuccess)
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
                Context.Response.Write(test.F_QueryMatarilGroup(ctx, Params));
                return;
            }
            //客户分组数据查询接口
            else if (jParams["formid"].ToString().Equals("BD_CUSTOMERGROUP"))
            {
                Context ctx = null;
                bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
                if (!logSuccess)
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
                Context.Response.Write(test.F_QueryCustomerGroup(ctx, Params));
                return;
            }
            //成本接口
            else if (jParams["formid"].ToString().Equals("BD_COSTPRICE"))
            {
                Context ctx = null;

                bool logSuccess = CommonService.LoginSystemAuth(jParams, result, out ctx);
                if (!logSuccess)
                {
                    Context.Response.Write(result.ToString());
                    return;
                }
                Context.Response.Write(test.F_GetCostPrice(ctx, Params));
                return;
            }
            else
            {
                Context.Response.Write(test.F_Query(Params));
                return;
            }
        }
        #endregion

        #region 单据保存
        [WebMethod(Description = "单据保存")]
        public void K3BillSave(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            Context.Response.Write(test.F_Save(Params));
            return;
        }
        #endregion

        #region 单据提交
        [WebMethod(Description = "单据提交")]
        public void K3BillSubmit(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            Context.Response.Write(test.F_Submit(Params));
            return;
        }
        #endregion

        #region 单据审核
        [WebMethod(Description = "单据审核")]
        public void K3BillAudit(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            Context.Response.Write(test.F_Audit(Params));
            return;
        }
        #endregion

        #region 单据反审核
        [WebMethod(Description = "单据反审核")]
        public void K3BillUnAudit(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            Context.Response.Write(test.F_UnAudit(Params));
            return;
        }
        #endregion

        #region 单据下推
        [WebMethod(Description = "单据下推")]
        public void K3BillPush(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            Context.Response.Write(test.F_Push(Params));
            return;
        }
        #endregion

        #region 单据删除
        [WebMethod(Description = "单据删除")]
        public void K3BillDelete(string Params)
        {
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";

            JObject result = new JObject();
            JObject jParams = new JObject();
            result.Add("Result", false);
            result.Add("Message", string.Empty);
            result.Add("Data", string.Empty);

            try
            {
                if (!string.IsNullOrEmpty(Params))
                {
                    jParams = JObject.Parse(Params);
                }
                else
                {
                    result["Message"] = "请输入参数！";
                    Context.Response.Write(result.ToString());
                    return;
                }
            }
            catch (Exception)
            {
                result["Message"] = "json解析错误，请检查报文！";
                Context.Response.Write(result.ToString());
                return;
            }

            K3BillBusinessHelper test = new K3BillBusinessHelper();
            Context.Response.Write(test.F_Delete(Params));
            return;
        }
        #endregion

        #region 单据作废
        #endregion
        #endregion
    }

    public class _Default1 : Page
    {
        protected HtmlForm form1;
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
